import { createStore, combineReducers, compose, applyMiddleware } from 'redux';
import createPromiseMiddleware from 'redux-promise-middleware';
import userReducer from '@/router/Login/reducer';
const reducer = combineReducers({
  user: userReducer
});
const middlewares = [createPromiseMiddleware]; // 这边可以加入其他到中间件 比如thunk logger
// const middlewares = [logger, thunk];//
const win = window;
const storeEnhancers = compose(
  applyMiddleware(...middlewares),
  (win && win.devToolsExtension) ? win.devToolsExtension() : f => f
);

const initialState = {};
export default createStore(reducer, initialState, storeEnhancers);